#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMdiArea>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void setupMenus();

    static MainWindow* getMainWindow() {
        return ts;
    }


private slots:
    void onUserRegisterActionCliked();
    void onUserDeleteActionCliked();
    void onUserUpdateActionCliked();
    void onMedicineAddActionCliked();
    void onMedicineDeleteActionCliked();
    void onMedicineUpdateActionCliked();
    void onMedicineQueryActionCliked();
    void onStockCheckActionCliked();
    void onExpiryCheckActionCliked();
    void onPurchaseOrderCreateActionCliked();
    void onSalesRecordQueryActionCliked();
    void onMedicineTakeActionCliked();
    void onPurchaseRecordQueryActionCliked();

private:
    QMdiSubWindow* createSubWindow(QWidget* widget);

private:
    Ui::MainWindow *mainwindowUi;
    QMenu *userManagementMenu;
    QMenu *medicineManagementMenu;
    QMenu *inventoryManagementMenu;
    QMenu *orderManagementMenu;

    static MainWindow* ts;
};

#endif // MAINWINDOW_H
